package com.example.sparkchaindemo;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class SparkMainActivity extends AppCompatActivity implements View.OnClickListener {
    private Button main_ai_kit, main_rtasr, main_aisound;
    private TextView tv_notification;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.spark_main);
        initView();
    }

    private void initView() {
        main_ai_kit = findViewById(R.id.main_ai_kit);
        main_rtasr = findViewById(R.id.main_rtasr);
        main_aisound = findViewById(R.id.main_aisound);

        main_ai_kit.setOnClickListener(this);
        main_rtasr.setOnClickListener(this);
        main_aisound.setOnClickListener(this);
    }

    private void jump(Class jumpAct) {
        try {
            Intent intent = new Intent(this, jumpAct);
            startActivity(intent);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (id == R.id.main_ai_kit) {
            jump(IVWActivity.class);
        } else if (id == R.id.main_rtasr) {
            jump(RTASRActivity.class);
        } else if (id == R.id.main_aisound) {
            jump(AisoundActivity.class);
        }
    }
}
